package com.dianping.cat.consumer.problem.model.entity;

import com.dianping.cat.consumer.problem.model.BaseEntity;
import com.dianping.cat.consumer.problem.model.IVisitor;
import java.util.LinkedHashMap;
import java.util.Map;






public class JavaThread
  extends BaseEntity<JavaThread>
{
  private String m_groupName;
  private String m_name;
  private String m_id;
/*  19 */   private Map<Integer, Segment> m_segments = new LinkedHashMap();





  public JavaThread(String id) { this.m_id = id; }




/*  30 */   public void accept(IVisitor visitor) { visitor.visitThread(this); }


  public JavaThread addSegment(Segment segment) {
/*  34 */     this.m_segments.put(segment.getId(), segment);
/*  35 */     return this;
  }


  public boolean equals(Object obj) {
/*  40 */     if (obj instanceof JavaThread) {
/*  41 */       JavaThread _o = (JavaThread)obj;

/*  43 */       if (!equals(getId(), _o.getId())) {
/*  44 */         return false;
      }

/*  47 */       return true;
    }

/*  50 */     return false;
  }


/*  54 */   public Segment findSegment(Integer id) { return (Segment)this.m_segments.get(id); }


  public Segment findOrCreateSegment(Integer id) {
/*  58 */     Segment segment = (Segment)this.m_segments.get(id);

/*  60 */     if (segment == null) {
/*  61 */       synchronized (this.m_segments) {
/*  62 */         segment = (Segment)this.m_segments.get(id);

/*  64 */         if (segment == null) {
/*  65 */           segment = new Segment(id);
/*  66 */           this.m_segments.put(id, segment);
        }
      }
    }

/*  71 */     return segment;
  }


/*  75 */   public String getGroupName() { return this.m_groupName; }



/*  79 */   public String getId() { return this.m_id; }



/*  83 */   public String getName() { return this.m_name; }



/*  87 */   public Map<Integer, Segment> getSegments() { return this.m_segments; }






  public void mergeAttributes(JavaThread other) {
/* 101 */     assertAttributeEquals(other, "thread", "id", this.m_id, other.getId());

/* 103 */     if (other.getGroupName() != null) {
/* 104 */       this.m_groupName = other.getGroupName();
    }

/* 107 */     if (other.getName() != null) {
/* 108 */       this.m_name = other.getName();
    }
  }


/* 113 */   public Segment removeSegment(Integer id) { return (Segment)this.m_segments.remove(id); }


  public JavaThread setGroupName(String groupName) {
/* 117 */     this.m_groupName = groupName;
/* 118 */     return this;
  }

  public JavaThread setId(String id) {
/* 122 */     this.m_id = id;
/* 123 */     return this;
  }

  public JavaThread setName(String name) {
/* 127 */     this.m_name = name;
/* 128 */     return this;
  }

  public JavaThread() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/lib/cat-consumer-3.0.0.jar!/com/dianping/cat/consumer/problem/model/entity/JavaThread.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */